package gamble.qna.command;

import gamble.qna.dao.BoardDaoImp;
import gamble.qna.vo.BoardVO;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

public class UpdateController {
	
private BoardDaoImp dao;
	
	public void setDao(BoardDaoImp dao) {
		this.dao = dao;
	}

	@RequestMapping("/update.js")
	protected ModelAndView replayMethod(HttpServletRequest req,BoardVO vo) {
		
		String currentPage=req.getParameter("currentPage");
		
		vo=dao.getView(vo.getNum());
		ModelAndView mv=new ModelAndView();
		mv.addObject("vo",vo);
		mv.addObject("currentPage", currentPage);
		mv.setViewName("updateForm");
		return mv;
	}

}